<template>
    <el-dialog v-model="dialogVisible" title="联系人员信息" :close-on-click-modal="false" width="480px">
        <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="customName" label="联系人姓名" width="100" />
            <el-table-column prop="phone" label="手机号" width="120"/>
            <el-table-column prop="sex" label="性别" width="60">
                <template #default="scope">
                    <div>
                        {{ scope.row.sex === 2 ? '男' : '女' }}
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="remark" label="备注" />
        </el-table>
        <!-- <template #footer>
            <div class="flex flex-jc-c">
                <div class="flex">
                    <el-button @click="dialogVisible = false">取消</el-button>
                    <el-button type="primary" @click="submit">
                        确定
                    </el-button>
                </div>
            </div>
        </template> -->
    </el-dialog>
</template>
<script setup>
import { ref, watch } from 'vue'
import { getSassContactList } from '@/api/clients/signClient.ts'
const props = defineProps({
    show: {
        type: Boolean,
        default: false
    },
    companyId: {
        type: [Number, String]
    },
    dealId: {
        type: [Number, String]
    },
})

const emits = defineEmits(['update:show', 'success'])

const dialogVisible = ref(false)
const tableData = ref([])

watch(() => props.show, (newval) => {
    dialogVisible.value = newval
    if (newval) {
        getData()
    }
})

watch(dialogVisible, (newval) => {
    emits('update:show', newval)
})

const getData = () => {
    getSassContactList({
        companyId: props.companyId,
        dealId: props.dealId
    }).then(res => {
        tableData.value = res
    })
}



</script>
<style lang="scss" scoped>
.bg-gray {
    background: #fafafc;
}

.table-item {
    height: 40px;
    line-height: 40px;
    border-top: 1px solid $borderColor;
    cursor: move;
}

.table-head {
    height: 40px;
    line-height: 40px;
}
</style>